// Time:  O(n)
// Space: O(n)

#include <vector>
#include <unordered_set>

using namespace std;

class Solution {
public:
    int distributeCandies(vector<int>& candyType) {
        unordered_set<int> lookup;
        for (const auto& candy: candyType) {
            lookup.emplace(candy);
        }
        return min(lookup.size(), candyType.size() / 2);
    }
};
